package com.disability_federation.controller;

import com.disability_federation.mapper.MapperCountyAmountsCollection;
import com.disability_federation.pojo.CountyAmountsCollection;
import com.disability_federation.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 县级残保金代收名单（地税局）操作接口
 */
@RestController
@CrossOrigin
public class ControllerCountyAmountsCollection {

    @Autowired
    private MapperCountyAmountsCollection mapperCountyAmountsCollection;

    /**
     * 查询全部代收名单
     * 默认时间升序排序
     */
    @RequestMapping("CAC/query")
    public Result query(){
        return Result.success(mapperCountyAmountsCollection.query());
    }

    /**
     * 查询全部代收名单
     * 时间降序排序
     */
    @RequestMapping("CAC/query/time_desc")
    public Result queryDesc(){
        return Result.success(mapperCountyAmountsCollection.queryDesc());
    }

    /**
     * 查询全部代收名单
     * 金额升序排序
     */
    @RequestMapping("CAC/query/money_asc")
    public Result queryMoneyAsc(){
        return Result.success(mapperCountyAmountsCollection.queryMoneyAsc());
    }

    /**
     * 查询全部代收名单
     * 金额降序排序
     */
    @RequestMapping("CAC/query/money_desc")
    public Result queryMoneyDesc(){
        return Result.success(mapperCountyAmountsCollection.queryMoneyDesc());
    }

    /**
     * 查询全部代收名单
     * 姓名升序排序
     */
    @RequestMapping("CAC/query/name_asc")
    public Result queryNameAsc(){
        return Result.success(mapperCountyAmountsCollection.queryNameAsc());
    }

    /**
     * 查询全部代收名单
     * 姓名降序排序
     */
    @RequestMapping("CAC/query/name_desc")
    public Result queryNameDesc(){
        return Result.success(mapperCountyAmountsCollection.queryNameDesc());
    }

    /**
     * 查询全部代收名单
     * 企业升序排序
     */
    @RequestMapping("CAC/query/enterprise_asc")
    public Result queryEnterpriseAsc(){
        return Result.success(mapperCountyAmountsCollection.queryEnterpriseAsc());
    }

    /**
     * 查询全部代收名单
     * 企业降序排序
     */
    @RequestMapping("CAC/query/enterprise_desc")
    public Result queryEnterpriseDesc(){
        return Result.success(mapperCountyAmountsCollection.queryEnterpriseDesc());
    }

    /**
     * 条件查询代收名单
     * 默认时间升序排序
     */
    @RequestMapping("CAC/query/condition")
    public Result queryCondition(String name, String enterprise, Integer money1, Integer money2){
        return Result.success(mapperCountyAmountsCollection.queryCondition(name, enterprise, money1, money2));
    }

    /**
     * 条件查询代收名单
     * 时间降序排序
     */
    @RequestMapping("CAC/query/condition/time_desc")
    public Result queryConditionDesc(String name, String enterprise, Integer money1, Integer money2){
        return Result.success(mapperCountyAmountsCollection.queryConditionDesc(name, enterprise, money1, money2));
    }

    /**
     * 条件查询代收名单
     * 金额升序排序
     */
    @RequestMapping("CAC/query/condition/money_asc")
    public Result queryConditionMoneyAsc(String name, String enterprise, Integer money1, Integer money2){
        return Result.success(mapperCountyAmountsCollection.queryConditionMoneyAsc(name, enterprise, money1, money2));
    }

    /**
     * 条件查询代收名单
     * 金额降序排序
     */
    @RequestMapping("CAC/query/condition/money_desc")
    public Result queryConditionMoneyDesc(String name, String enterprise, Integer money1, Integer money2){
        return Result.success(mapperCountyAmountsCollection.queryConditionMoneyDesc(name, enterprise, money1, money2));
    }

    /**
     * 条件查询代收名单
     * 姓名升序排序
     */
    @RequestMapping("CAC/query/condition/name_asc")
    public Result queryConditionNameAsc(String name, String enterprise, Integer money1, Integer money2){
        return Result.success(mapperCountyAmountsCollection.queryConditionNameAsc(name, enterprise, money1, money2));
    }

    /**
     * 条件查询代收名单
     * 姓名降序排序
     */
    @RequestMapping("CAC/query/condition/name_desc")
    public Result queryConditionNameDesc(String name, String enterprise, Integer money1, Integer money2){
        return Result.success(mapperCountyAmountsCollection.queryConditionNameDesc(name, enterprise, money1, money2));
    }

    /**
     * 条件查询代收名单
     * 企业升序排序
     */
    @RequestMapping("CAC/query/condition/enterprise_asc")
    public Result queryConditionEnterpriseAsc(String name, String enterprise, Integer money1, Integer money2){
        return Result.success(mapperCountyAmountsCollection.queryConditionEnterpriseAsc(name, enterprise, money1, money2));
    }

    /**
     * 条件查询代收名单
     * 企业降序排序
     */
    @RequestMapping("CAC/query/condition/enterprise_desc")
    public Result queryConditionEnterpriseDesc(String name, String enterprise, Integer money1, Integer money2){
        return Result.success(mapperCountyAmountsCollection.queryConditionEnterpriseDesc(name, enterprise, money1, money2));
    }
}
